#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int jc(int p)
{
	long long count = 1;
	for (int i = 1; i <= p; i++)
	{
		 count *= i;
	}
	return count;
}
int main()
{
	/*int arr[100];
	int n = 0;
	int i;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr[i]);
	}
	
	for (i = 0; i < n; i++)
	{
		int count = 0;
		for (int j = 0; j < n; j++)
		{
			if (arr[j] < arr[i])
			{
				count++;
			}
		}
		printf("%d ", count);
	}*/
	/*int arr[100];
	int i = 0;
	scanf("%d", &arr[0]);
	if(arr[0])
	{
		while (arr[i])
		{
			i++;
			scanf("%d", &arr[i]);
		}
		for (int j = i - 1; j >= 0; j--)
		{
			printf("%d ", arr[j]);
		}
	}*/
	
	int n;
	scanf("%d", &n);
	int sum = 0;
	for (int i = 1; i <= n;i++)
	{
		sum += jc(i);
	}
	printf("%d", sum);
	return 0;
}
